package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.ChanceFlowNode;
import com.sl.au.entity.OperateLog;


@Transactional(readOnly = true)
public interface ChanceFlowNodeRepository extends JpaRepository<ChanceFlowNode, String > {
	
	/**
	 * 获取流转记录
	 * @param key
	 * @param pageable
	 * @return
	 */
	@Query("select cf from ChanceFlowNode cf where cf.chance.id = ?1")
	Page<ChanceFlowNode> findFlows(String ChanceId,Pageable pageable);
	
	@Query("select count(*) from ChanceFlowNode cf where cf.chance.id = ?1")
	long getCount(String chanceId);

}
